[Precogs Alert] Cross-Site Scripting (XSS) detected (CWE-79, Risk: Critical)#31
Open
sameer6pre wants to merge 1 commit intoPrecogs-fix-wio3jzc0from
Open
[Precogs Alert] Cross-Site Scripting (XSS) detected (CWE-79, Risk: Critical)#31sameer6pre wants to merge 1 commit intoPrecogs-fix-wio3jzc0from
sameer6pre wants to merge 1 commit intoPrecogs-fix-wio3jzc0from
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Vulnerability Details
orbit-app/src/components/CommentsSection.jsxExplanation:
The code renders user-supplied comments using React's
dangerouslySetInnerHTML, directly injecting thecmt.commentproperty into the DOM as HTML. Since comments are submitted by users and fetched from the backend, an attacker can submit a comment containing malicious HTML or JavaScript (e.g., <script>alert(1)</script>). When this comment is rendered, the browser will execute the script, resulting in a stored XSS vulnerability. This allows attackers to steal session cookies, perform actions as other users, or deface the site. The root cause is the lack of sanitization or encoding of user input before rendering it as HTML.Please review and address the issue accordingly.